#include "mymembertable.h"
#include "global.h"
#include <QHeaderView>

MyMemberTable::MyMemberTable(QWidget *parent) : MyTableWidget(parent)
{

}

void MyMemberTable::setMemberHorizontalHeaderStyle(QFont headerFont, QString styleSheet, bool headFixed)
{
    setHorizontalHeaderStyle( headerFont,  styleSheet,  headFixed);
    // 随文字变更表头大小
   horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
   return;
}

void MyMemberTable::setMemberItemStyle(QBrush color, QFont itemFont, int row, int col)
{
    QTableWidgetItem *pItem = item(row, col);
    if(NULL == pItem){
        QLOG_WARN() << "NULL == pItem";
        return;
    }

    setItemStyle(color, itemFont, row, col);

    // 仅姓名列可编辑
    if(COLUMN_NAME == col)
        pItem->setFlags((Qt::ItemFlags) 63);

    return;
}

void MyMemberTable::removeMemberSpecificRow(int row)
{

    removeRow(row);

    return;
}

